// /**
//  * Copyright © 2016 Magento. All rights reserved.
//  * See COPYING.txt for license details.
//  */

//
//  Main elements -> Actions bar -> Store Switcher
//  _____________________________________________

//  ToDo UI: Consist old styles, should be changed with new design

.store-switcher {
    color: @text__color; // ToDo UI: Delete with admin scope
    float: left;
    font-size: round(@font-size__base - .1rem, 1);
    margin-top: .7rem;

    .admin__action-dropdown {
        margin-left: .5em;
        background-color: @page-main-actions__background-color;
    }

    .dropdown {
        .lib-dropdown(
        @_options-selector: ~".dropdown-menu",
        @_dropdown-list-border: 1px #ada89e solid,
        @_dropdown-list-pointer: false,
        @_icon-font-line-height: 2,
        @_icon-font-color: @text__color,
        @_icon-font-color-hover: @text__color,
        @_icon-font-color-active: @text__color,
        @_dropdown-list-item-hover: transparent,
        @_dropdown-list-item-padding: 0,
        @_dropdown-list-min-width: 19.5rem,
        @_dropdown-list-shadow: @component__box-shadow__base
        );
    }

    .dropdown-menu {
        left: 0;
        margin-top: .5em;
        padding-top: .25em;

        li {
            border: 0;
            cursor: default;

            &:hover {
                cursor: default;
            }

            a,
            span {
                color: @text__color;
                display: block;
                padding: .5rem 1.3rem;
            }

            a {
                text-decoration: none;

                &:hover {
                    background: @color-lighter-gray;
                }
            }

            span {
                color: @color-gray68;
                cursor: default;
            }

            &.current {
                span {
                    background: #eee;
                    color: @text__color;
                }
            }
        }

        .store-switcher-store {
            a,
            span {
                padding-left: 2.6rem;
            }
        }

        .store-switcher-store-view {
            a,
            span {
                padding-left: 3.9rem;
            }
        }

        .dropdown-toolbar {
            border-top: 1px solid @color-gray92;
            margin-top: 1rem;

            a {
                &:before {
                    &:extend(.abs-icon all);
                    content: @icon-systems__content;
                    margin-right: .25em;
                    position: relative;
                    top: 1px;
                }
            }
        }
    }
}

.store-switcher-label {
    font-weight: @font-weight__bold;
}

.store-switcher-alt {
    display: inline-block;
    position: relative;

    &.active {
        .dropdown-menu {
            display: block;
        }
    }

    .dropdown-menu {
        margin-top: 2px;
        white-space: nowrap;

        ul {
            list-style: none;
            margin: 0;
            padding: 0;
        }
    }

    strong {
        color: #a6a098;
        display: block;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.333;
        padding: 5px 10px;
    }

    .store-selected {
        color: #676056;
        cursor: pointer;
        font-size: 12px;
        font-weight: 400;
        line-height: 1.333;

        &:after {
            color: #b3b0ad;
            content: '\e02c'; /* arrow down icon */
            -webkit-font-smoothing: antialiased;
            font-style: normal;
            font-weight: normal;
            margin: 0 0 0 3px;
            speak: none;
            vertical-align: text-top;
        }
    }

    .store-switcher-website,
    .store-switcher-store {
        padding: 0;

        &:hover {
            background: none;
        }
    }

    .store-switcher-store-view {
        padding: 0;
    }

    .store-switcher-all,
    .manage-stores {
        padding: 0;

        > a {
            color: #676056;
            display: block;
            font-size: 12px;
            padding: 8px 15px;
            text-decoration: none;
        }
    }
}

.store-switcher-website {
    margin: 5px 0 0;

    > strong {
        padding-left: 13px;
    }
}

.store-switcher-store {
    margin: 1px 0 0;

    > strong {
        padding-left: 20px;
    }

    > ul {
        margin-top: 1px;
    }
}

.store-switcher-store-view {
    &:first-child {
        border-top: 1px solid #e5e5e5;
    }

    > a {
        color: #333;
        display: block;
        font-size: 13px;
        padding: 5px 15px 5px 24px;
        text-decoration: none;
    }
}

.store-view {
    &:not(.store-switcher) {
        float: left;
    }

    .store-switcher-label {
        display: inline-block;
        margin-top: @indent__s;
    }
}

//
//  Tooltip
//  ---------------------------------------------

.tooltip {
    display: inline-block;
    margin-left: .5em;

    .help {
        span,
        a {
            cursor: pointer;
            display: inline-block;
            height: 22px;
            position: relative;
            vertical-align: middle;
            width: 22px;
            z-index: 2;

            &:before {
                &:extend(.abs-icon all);
                color: @text__color;
                content: @icon-help__content;
                font-size: 1.7rem;
            }

            span {
                &:extend(.abs-visually-hidden all);
            }
        }

        a {
            &:hover {
                text-decoration: none;
            }
        }
    }

    .tooltip-content {
        background: rgba(49, 48, 43, .8);
        background: #000;
        border-radius: 3px;
        color: #fff;
        display: none;
        margin-left: -19px;
        margin-top: 10px;
        max-width: 200px;
        padding: 4px 8px;
        position: absolute;
        text-shadow: none;
        z-index: 20;

        &:before {
            border-bottom: 5px solid #000;
            border-left: 5px solid transparent;
            border-right: 5px solid transparent;
            content: '';
            height: 0;
            left: 20px;
            opacity: .8;
            position: absolute;
            top: -5px;
            width: 0;
        }

        &.loading {
            position: absolute;

            &:before {
                border-bottom-color: rgba(0, 0, 0, .3);
            }
        }
    }

    &:hover > .tooltip-content {
        display: block;
    }
}
